package lab6;

import java.util.Date;


 class Time {
	private int hour, minute, second;


    public Time() {
        final Date date = new Date();
        hour = date.getHours();
        minute = date.getMinutes();
        second = date.getSeconds();
    }


    public Time(long elapsedTime) {
        final Date date = new Date(elapsedTime);
        hour = date.getHours() - 8;
        minute = date.getMinutes();
        second = date.getSeconds();
    }


    public Time(int hour, int minute, int second) {
        this.hour = hour;
        this.minute = minute;
        this.second = second;
    }


    public int getHour() {
        return hour;
    }
    public int getMinute() {
        return minute;
    }
    public int getSecond() {
        return second;
    }

    public void setTime(long elapseTime) {
        final Date date = new Date(elapseTime);
        hour = date.getHours() - 8;
        minute = date.getMinutes();
        second = date.getSeconds();
    }
}
 public class TimeTest {
	    public static void main(String[] args) {
	        final Time t1 = new Time();
	        final Time t2 = new Time(555550000);

	        System.out.println("Hour: " + t1.getHour() + " Minute: " + t1.getMinute() + " Second: " + t1.getSecond());
	        System.out.println("Hour: " + t2.getHour() + " Minute: " + t2.getMinute() + " Second: " + t2.getSecond());
	    }
	}
